package com.theyeasy.dvmini.service;

import java.util.List;
import java.util.Set;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.theyeasy.dvmini.model.WebSockMsg;
import com.theyeasy.dvmini.vo.Vo_msg;

public interface DvminiSocketService {

	Logger log = LoggerFactory.getLogger(DvminiSocketService.class);

	/** 记录未读消息key */
	public static final String CHATLOG = "chatlog_";
	/** 记录通讯状态 */
	public static final String ChATSTATUS = "chat_status_";

	/** 保存正在跟谁聊天的信息 */
	public static final String CHATVIEWLIST = "chat_view_list_";

	public static String KEY_VANKER = "chat_customer_vanker";
	public static String KEY_SALES = "chat_customer_sales";

	/**
	 * 接受消息
	 * 
	 * @param msg
	 */
	public void recevice(WebSockMsg msg);

	/**
	 * 清理缓存
	 * 
	 * @param msg
	 */
	public void cleanCache(WebSockMsg msg,boolean hard);

	/**
	 * 获取未读消息
	 * 
	 * @param msg
	 * @return
	 */
	public List<WebSockMsg> getMsgCache(WebSockMsg msg);

	/**
	 * 获取未读消息数
	 * 
	 * @param msg
	 * @return
	 */
	public Long unReadedSize(WebSockMsg msg);

	void pushChatList(WebSockMsg msg);

	Set<Integer> popChatList(WebSockMsg msg);

	boolean handleProcess(String openId, String content, String imageUrl);

	public void updateChatStatus(Integer salesId, Integer fansId);

	boolean checkChatStatus(Integer salesId, Integer fansId);

	void removeChatStatus(Integer salesId, Integer fansId);
}
